<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
    </head>
    <body>
        <div id="box1"></div>
        <div id="box2"></div>

        <script>
            var box = document.getElementById('box1');
            console.log(box1);
        </script>
    </body>
</html>